<template>
	<view class="box" style="padding: 0 36rpx;width: 678rpx;margin: 36rpx 36rpx 0 36rpx;">
		<view class="i"><text style="width: 150rpx;">账号姓名</text><text
				:style="{'flex':1,'color':'#020618'}">{{realName}}</text>
		</view>
		<view class="i"><text style="width: 150rpx;">支付宝账号</text><input v-model="code" placeholder="请输入支付宝账号"
				placeholder-style="color:#90A1B9;" />
		</view>
	</view>
	<view style="margin: 36rpx;font-size: 28rpx;">请务必确保所填写账号为本人账号，支付宝账号的实名信息需与平台账号一致，否则将无法提现</view>
	<view class="btn" @click="submit"
		:style="{'background-color': code?'#FFDF20':'#CAD5E2','color': code?'##020618':'#ffffff'}">
		确认</view>

</template>

<script>
	import api from '@/utils/api.js';
	export default {
		data() {
			return {
				realName: '',
				code: ''
			}
		},
		async onLoad(options) {
			this.realName = options.realName;
		},
		methods: {
			async submit() {
				if (!this.code) {
					uni.showToast({
						title: '请输入支付宝账号',
						icon: 'none',
						duration: 1500
					})
					return;
				}
				await api.bind_third_member_account({
					code: this.code,
					channelCode: 'aliAccount'
				});
				uni.showToast({
					title: '绑定成功',
					icon: 'success',
					duration: 1500
				})
				setTimeout(() => {
					uni.navigateBack({
						delta: 1
					})
				}, 1500)
			},
		}
	}
</script>

<style>
	.i {
		width: 100%;
		height: 120rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 40rpx;
		color: #62748E;
		font-size: 30rpx;
	}

	.box .i {
		border-bottom: 1px solid #E2E8F0;
	}

	.box .i:last-child {
		border: none;
	}

	.box .i input {
		flex: 1;
		height: 100%;
		color: #020618;
	}

	.bank {
		height: 100rpx;
		width: 678rpx;
		margin: 0 36rpx 20rpx 36rpx;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 30rpx;
		background-color: #F8FAFC;
		padding: 0 36rpx;
		box-sizing: border-box;
	}

	.btn {
		width: 678rpx;
		margin-left: 36rpx;
		font-size: 34rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 30rpx;
		height: 100rpx;
	}
</style>